package com.yejiarong.weather.controller;

import com.yejiarong.common.tools.HttpResult;
import com.yejiarong.weather.bean.dto.FutureDayWeatherDto;
import com.yejiarong.weather.bean.vo.FutureDayWeatherVo;
import com.yejiarong.weather.service.IFutureWeatherService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author YeJR
 */
@RestController
@RequestMapping(value = "/futureWeather")
public class FutureWeatherController {

    private final IFutureWeatherService futureWeatherService;

    public FutureWeatherController(IFutureWeatherService futureWeatherService) {
        this.futureWeatherService = futureWeatherService;
    }

    /**
     * 未来某一天的详细天气信息
     * @param dto dto
     * @return HttpResult
     */
    @PostMapping(value = "/dayWeatherDetail")
    public HttpResult<FutureDayWeatherVo> getFutureDayWeatherVo(@RequestBody FutureDayWeatherDto dto) {
        return HttpResult.success(futureWeatherService.getFutureDayWeatherVo(dto));
    }
}
